<!DOCTYPE HTML>
<html>
	<head>
		<title>single-page</title>
		<link href="__PUBLIC__/css/style.css" rel='stylesheet' type='text/css' />
				
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<link rel="shortcut icon" type="image/x-icon" href="__PUBLIC__/images/fav-icon.png" />
		<script type="application/x-javascript"> addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false); function hideURLbar(){ window.scrollTo(0,1); } </script>
		</script>
		<!----webfonts---->
		<link href='https://fonts.googleapis.com/css?family=Open+Sans:400,300,600,700,800' rel='stylesheet' type='text/css'>
		<style type="text/css">
			div{word-break:break-all;word-wrap: break-word;}

  		</style>
		<!----//webfonts---->
		<!---start-click-drop-down-menu----->
		<script src="__PUBLIC__/js/jquery.min.js"></script>
        <!----start-dropdown--->
         <script type="text/javascript">
			var $ = jQuery.noConflict();
				$(function() {
					$('#activator').click(function(){
						$('#box').animate({'top':'0px'},500);
					});
					$('#boxclose').click(function(){
					$('#box').animate({'top':'-700px'},500);
					});
				});
				$(document).ready(function(){
				//Hide (Collapse) the toggle containers on load
				$(".toggle_container").hide(); 
				//Switch the "Open" and "Close" state per click then slide up/down (depending on open/close state)
				$(".trigger").click(function(){
					$(this).toggleClass("active").next().slideToggle("slow");
						return false; //Prevent the browser jump to the link anchor
				});
									
			});
		</script>
        <!----//End-dropdown--->
	</head>
	<body>
		<!---start-wrap---->
			<!---start-header---->
			<div class="header">
				<div class="wrap">
				<div class="logo">
					<!-- <a href="index.html"><img src="__PUBLIC__/images/logo.png" title="pinbal" /></a> -->
					<a href="index.html" style="font-family:'MingLiU';color:#990099"><img src="__PUBLIC__/images/logo.png" title="pinbal" />{$school}校园表白墙</a>
				</div>
				<div class="nav-icon">
					 <a href="#" class="right_bt" id="activator"><span> </span> </a>
				</div>
				 <div class="box" id="box">
					 <div class="box_content">        					                         
						<div class="box_content_center">
						 	<div class="form_content">
								<div class="menu_box_list">
									<ul>

										<li><a href="{:U('Home/Index/index')}"><span>首页</span></a></li>

										<li><a href="{:U('Home/Index/add')}?do=chk"><span>发布表白</span></a></li>
										
										<!-- <li><a href="{:U('Home/Register/Index')}"><span>注册</span></a></li> -->
										<li><a href="http://koudaigou.net/f/58ff5b7de7aea93af3d06532"><span>意见反馈</span></a></li>
										<li><a href="{:U('/Home/User/LogOut')}"><span>退出登录</span></a></li>
										<li><a href="contact.html"><span></span></a></li>
										<div class="clear"> </div>
									</ul>
								</div>
								<a class="boxclose" id="boxclose"> <span> </span></a>
							</div>                                  
						</div> 	
					</div> 
				</div>       	  
				<div class="top-searchbar">
					<form>
						<input type="text" /><input type="submit" value="" />
					</form>
				</div>
				<div class="userinfo">
					<div class="user">
						<ul>
							<if condition="$flag eq false ">
								<li><a href="{:U('Home/Login/Index')}"><img src="__PUBLIC__/images/user-pic.png" title="user-name" /><span>请登录</span></a>
								<input type="text" name="loginId" value="{$uid}">
								</li>
							<else />
								<li><a href="{:U('Home/User/index')}"><img src="{$headImgSrc}" title="user-name" style="width:2.5rem;height:2.5rem;" /><span>个人中心</span></a>
								     <input type="text" name="loginId" value="{$uid}">
								</li>
							</if>
						</ul>
					</div>
				</div>
				<div class="clear"> </div>
			</div>
		</div>
		<!---//End-header---->
		<!---start-content---->
		<div class="content">
			<div class="wrap">
				<div class="single-page">
						<div class="single-page-artical">

							<div class="artical-content">
								<!-- <img src="__PUBLIC__/images/single-post-pic.jpg" title="banner1"> -->
								<h3><a href="#">{$page.content}</p> 
							    </div>
							    <div class="artical-links">
	  						 	<ul>
	  						 		<li><a href="#"><img src="__PUBLIC__/images/blog-icon2.png" title="Admin"><span>admin</span></a></li>
	  						 		<li><a href="#"><img src="__PUBLIC__/images/blog-icon3.png" title="Comments"><span>No comments</span></a></li>
	  						 		<li><a href="#"><img src="__PUBLIC__/images/blog-icon4.png" title="Lables"><span>View posts</span></a></li>
	  						 	</ul>
	  						 </div>

	  						 <div class="share-artical">
	  						 	<ul>
	  						 		<li><a href="#"><img src="__PUBLIC__/images/facebooks.png" title="facebook">Facebook</a></li>
	  						 		<li><a href="#"><img src="__PUBLIC__/images/twiter.png" title="Twitter">Twiiter</a></li>
	  						 		<li><a href="#"><img src="__PUBLIC__/images/google+.png" title="google+">Google+</a></li>
	  						 		<li><a href="#"><img src="__PUBLIC__/images/rss.png" title="rss">Rss</a></li>
	  						 	</ul>
	  						 </div>
	  						 <div class="clear"> </div>
						</div>
						

						<!-- 发表评论 -->
						<div>							          		                    	
		                    <textarea  class="comment_box" style="width:100%;height:5rem;resize: none;" name="com"></textarea>
		                    <input type="hidden" name="pid" value="{$page.id}">
		                    <input type="hidden" name="uid" value="{$uid}">
							<button class="comment_btn"  style="position:relative;left:90%">发表评论</button> 
						</div>

						<!-- 发表评论 -->
				</div>
			</div>
		</div>
		<!---end-content---->

		<!---start-comments-section--->
		<div class="comment-section" style="position:relative;left:8rem">
			<div class="grids_of_2">
				<h2>Comments</h2>
					<foreach name="comment" item="val">
						<div class="grid1_of_2" style="border:1px solid #666;border-radius:10px">
							<div class="grid_img">
								<a href=""><img src="__PUBLIC__/images/pic10.jpg" alt=""></a>
							</div>
							<div class="grid_text">
								<h4 class="style1 list"><a href="#">{$val.ssid}:</a></h4>
								<h3 class="style">{$val.initime|date='Y-m-d',###}</h3>
								<p class="para top">{$val.comm}</p>
								<input type="text" name="uid" value="{$val.uid}" />
								<input type="text" name="pid" value="{$val.pid}" />
								<a href="javascript:;" class="btn1">Click to Reply</a>
								
								<div class="">								
									<input type="text" name="comm" value="" placeholder="请输入回复" />
									<button href="javascript:;" class="submit">提交</botton>
								</div>
								

							</div>
							<div class="clear"></div>
						</div>	
					</foreach>


						<div class="grid1_of_2 left">
							<div class="grid_img">
								<a href=""><img src="images/pic10.jpg" alt=""></a>
							</div>
							<div class="grid_text">
								<h4 class="style1 list"><a href="#">Designer First</a></h4>
								<h3 class="style">march 3, 2013 - 4.00 PM</h3>
								<p class="para top"> All the Lorem Ipsum generators on the Internet tend to repeat predefined chunks as necessary, making this the first true generator on the Internet. It uses a dictionary of over 200 Latin words, combined with a handful of model sentence structures, to generate Lorem Ipsum which looks reasonable.</p>
								<a href="" class="btn1">Click to Reply</a>
							</div>
							<div class="clear"></div>
						</div>	
						

						<div class="grid1_of_2">
							<div class="grid_img">
								<a href=""><img src="images/pic12.jpg" alt=""></a>
							</div>
							<div class="grid_text">
								<h4 class="style1 list"><a href="#">Ro Kanth</a></h4>
								<h3 class="style">march 2, 2013 - 12.50 AM</h3>
								<p class="para top"> All the Lorem Ipsum generators on the Internet tend to repeat predefined chunks as necessary, making this the first true generator on the Internet. It uses a dictionary of over 200 Latin words, combined with a handful of model sentence structures, to generate Lorem Ipsum which looks reasonable.</p>
								<a href="" class="btn1">Click to Reply</a>
							</div>
							<div class="clear"></div>
						</div>	

			</div>
		</div>
		<!---end-comments-section--->
		






		<!----start-footer--->
		<div class="footer">
			<p>Copyright &copy; 2015.Company name All rights reserved.More Templates <a href="http://www.cssmoban.com/" target="_blank" title="Ä£°åÖ®¼Ò">Ä£°åÖ®¼Ò</a> - Collect from <a href="http://www.cssmoban.com/" title="ÍøÒ³Ä£°å" target="_blank">ÍøÒ³Ä£°å</a></p>
		</div>
		<!----//End-footer--->
		<!---//End-wrap---->


		<script type="text/javascript">
		    $(function(){
		    	//初次评论		    	
				$(".comment_btn").click(function(){
					var pid=$(this).siblings("input[name='pid']").val();
					var uid=$(this).siblings("input[name='uid']").val();
					var com=$(this).siblings("textarea[name='com']").val();
					// alert(pid);
				
					if($(".comment_box").val()){
						 $.post('__CONTROLLER__/addComment',{"type":1,"pid":pid,"uid":uid,"com":com},function(res){
						 	// alert(res);
						 	if(res=="success"){
						 		 alert("评论成功！");
						 		 location.replace(location.href);//刷新当前页面
						 	}else{
						 		alert("评论失败！");
						 	}
				        })  
					}
				});
				//初次评论

				// 用户间评论
				$(".submit").click(function(){
					var loginId=$("input[name='loginId']").val();
					var reply_to_id=$(this).parent().siblings("input[name='uid']").val();
					var pid=$(this).parent().siblings("input[name='pid']").val();
					var comm=$(this).siblings("input[name='comm']").val();
					alert("文章号"+pid+":"+loginId+"回复:"+reply_to_id+":"+comm);return;
					$.post('__CONTROLLER__/addComment',{"type":2,"pid":pid,"loginId":loginId,"comm":comm,"reply_to_id":reply_to_id},function(res){
							if(res=="success"){
								alert("评论成功！");
						 		 location.replace(location.href);//刷新当前页面
							}
					})
				})

				// 用户间评论

			      
			   
		    })
		</script>
	</body>
</html>

